package com.xcmg.employee.service;

import com.xcmg.employee.mapper.StaffMapper;
import com.xcmg.employee.entity.Staff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StaffServiceImp implements StaffService{


    @Resource
    StaffMapper staffMapper;

    @Override
    public Staff findStaffById(int id) {
        return staffMapper.selectById(id);
    }

    @Override
    public int insertStaff(Staff depart) {

        int state= staffMapper.insert(depart);
        return state;

    }

    @Override
    public void deleteStaffById(int id) {

        int state= staffMapper.deleteById(id);
    }

    @Override
    public void updateStaff(Staff staff) {

        int state= staffMapper.updateById(staff);
    }


}
